# coding:utf-8
# author:fxh

#汉若塔
"""
递归精髓：
数学归纳法：

递归公式：
f(n) = 2^n-1 步骤
移动步骤：
base:
f(1): start->by->end
f(n): start->end->by
f(1): start->end->by
f(n):by->start->end
"""
#汉若塔
def hanRuoTa(n,start,end,by):
    if (n == 1):
        print("Move from "+ start+"  to  " + end)
    else:
        hanRuoTa(n-1,start,by,end)
        hanRuoTa(1,start,end,by)
        hanRuoTa(n-1,by,end,start)


if __name__ == '__main__':
    hanRuoTa(3,start="START",by="BY",end="END")